ofRegistryKey

fun <T> ofRegistryKey(defaultValue: Identifier, key: RegistryKey<Registry<T>>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values, defined from a RegistryKey. This can find both static and dynamic registries

Uses "minecraft:air" as the default value

Allowable identifiers in this validation will be cached after their first polling if the registry is a static; dynamic registry validation will NOT be cached as those registries can change while in game.

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.2.0, added dynamic registry lookup and caching 0.5.0

Parameters

defaultValue

the default value of the ValidatedIdentifier

key

RegistryKey for the registry whose ids are valid for this identifier

Throws

if the registry can't be found based on the provided key


fun <T> ofRegistryKey(defaultValue: Identifier, key: RegistryKey<Registry<T>>, predicate: Predicate<RegistryEntry<T>>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values, defined from a RegistryKey

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.2.0, added dynamic registry lookup and caching 0.5.0

Parameters

defaultValue

the default value of the ValidatedIdentifier

key

RegistryKey for the registry whose ids are valid for this identifier

predicate

Predicate tests an allowable subset of the registry


fun <T> ofRegistryKey(defaultValue: Identifier, key: RegistryKey<Registry<T>>, predicate: BiPredicate<Identifier, RegistryEntry<T>>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values, defined from a RegistryKey

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.5.0

Parameters

defaultValue

the default value of the ValidatedIdentifier

key

RegistryKey for the registry whose ids are valid for this identifier

predicate

Predicate tests an allowable subset of the registry


fun <T> ofRegistryKey(key: RegistryKey<Registry<T>>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values, defined from a RegistryKey

Uses "minecraft:air" as the default value

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.2.0, added dynamic registry lookup and caching 0.5.0

Parameters

key

RegistryKey for the registry whose ids are valid for this identifier


fun <T> ofRegistryKey(key: RegistryKey<Registry<T>>, predicate: BiPredicate<Identifier, RegistryEntry<T>>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values, defined from a RegistryKey

Uses "minecraft:air" as the default value

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.2.0, added dynamic registry lookup and caching 0.5.0

Parameters

key

RegistryKey for the registry whose ids are valid for this identifier

predicate

BiPredicate tests an allowable subset of the registry